package com.etc.dao;
import org.apache.ibatis.annotations.Param;
import java.util.List;

import com.etc.entity.Shoppingcart;
import org.springframework.stereotype.Repository;

@Repository
public interface ShoppingcartDao {
    int insert(Shoppingcart record);

    List<Shoppingcart> findByUserIdAndGoodsId(@Param("userId") Long userId, @Param("goodsId") Long goodsId);

    int updateByUserIdAndGoodsId(@Param("updated") Shoppingcart updated, @Param("userId") Long userId, @Param("goodsId") Long goodsId);

    List<Shoppingcart> findByUserId(@Param("userId") Long userId);

    int updatGoodsCount(@Param("goodsCount") int goodsCount, @Param("userId") Long userId, @Param("goodsId") Long goodsId);

    int deleteByUserIdAndGoodsId(@Param("userId") Long userId, @Param("goodsId") Long goodsId);

	int deleteByUserId(@Param("userId") Long userId);

}